<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>前后翻转</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            margin: 100px;
            background-color: pink;
        }
        ul li{
            float: left;
            margin: 0  5px;
            animation: 500px;
            width: 120px;
            height: 35px;
            list-style: none;
            line-height: 35px;
            text-align: center;
            perspective: 500px;
        }
        a{
            text-decoration: none;
            color: white;
        }
        .box{
            position: relative;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            transition: all  1s;
        }
        .fornt,.bottom{
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            /* 隐藏背面 */
            /* backface-visibility: hidden; */
        }
        .fornt{
            background-color: pink;
            z-index: 1;
            transform: translateZ(17.5px);
        }
        .bottom{
            background-color: skyblue;
            /* x一定是负值 */
            transform:  translateY(17.5px) rotateX(-90deg);
        }
        .box:hover{
            transform: rotateX(90deg);
        }
    </style>
</head>
<body>
    <ul>
        <li>
            <div class="box">
                <a href="" class="fornt">ling</a>
                <a href="" class="bottom">orm</a>
            </div>
        </li>
        <li>
            <div class="box">
                <a href="" class="fornt">wa!!!</a>
                <a href="" class="bottom">o!!!</a>
            </div>
        </li>
        <li>
            <div class="box">
                <a href="" class="fornt">511</a>
                <a href="" class="bottom">527</a>
            </div>
        </li>
    </ul>
</body>
</html>